package com.todo.member.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2025/3/4 03:58
 * @description
 */
@Getter
@AllArgsConstructor
public enum MedalClassifyEnum {

    COLLECT(1, "COLLECT", "收藏类"),
    LOGIN(2, "LOGIN", "登录类"),
    TASK(3, "TASK", "任务类"),
    HIDDEN(4, "HIDDEN", "隐藏类"),
    ;

    private static Map<Integer, MedalClassifyEnum> typeMap = Arrays
            .stream(MedalClassifyEnum.values())
            .collect(Collectors.toMap(MedalClassifyEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static MedalClassifyEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
